package com.bbz.spring.config;

import com.bbz.spring.bean.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

//使用PropertySource 读取外部配置文件中的key/value保存到运行的环境变量中。加载完成后，通过${}可以获取
@PropertySource(value = {"classpath:/person.properties"})
@Configuration
public class MainConfig4 {
    @Bean
    public Person person() {
        return new Person();
    }
}
